#include "stdafx.h"
#include <cmath>
enum TaskType {
	TaskTypeTesting = 0,
	TaskTypeCut = 1
};

class Task
{
protected:
	TaskType type;
	int size_x, size_y;
	double accuracy;
	int num_steps;
	double beta_accuracy;

	double* matrix;
	double* matrix2;
	double* diff;
public:
	Task(int x, int y, double acc, int steps);
	~Task();

	virtual void solve();
	double* getSolution();
	double* getSolution2();
	double* getDifference();

	int getSizeX() { return size_x; };
	int getSizeY() { return size_y; };
	void getReport(double& x_max, double& y_max, double& max, double& acc, int& st);
	TaskType getTaskType() { return type; };

protected:
	double* updateR(double* x, double* r, double* f);
	double getBeta(double* h, double* r);
	double* getH(double* h, double* r, double beta);
	double getAlpha(double* h, double* r);
	double* mulA(double* matrix);
	double scalarMul(double* v1, double* v2);
};
